how to count number of digits in a number in java